import { memo } from "react"
import { Link } from "react-router-dom"

const ArticleAction = (props) => {
    const { isOwn, slug } = props
    if (isOwn) {
        return (
            <span>
                <Link to={`/edit/${slug}`} className="btn btn-outline-secondary btn-sm">
                <i className="fa fa-cog"></i> 编辑
                </Link>
                {' '}
                <Link to={`/delete/${slug}`} className="btn btn-outline-danger btn-sm">
                <i class="fa fa-trash-o fa-lg"></i> 删除
                </Link>
            </span>
        )
    } else {
        return (
            <span>
                <button className="btn btn-outline-secondary btn-sm">
                <i class="fa fa-heart-o"></i> 关注
                </button>
                {' '}
                <button className="btn btn-outline-secondary btn-sm">
                <i class="fa fa-heart-o"></i> 喜欢
                </button>
            </span>
        )

    }

}

export default memo(ArticleAction)